package com.qipay.withdraw.config;

/**
 * Creator: Yao
 * Date:    2017/9/27
 * For:
 * Other:
 */
public enum WithdrawOperationEnum {

    WITHDRAW((byte) 0, "提现"),
    TRANSFER((byte) 1, "代付"),
    TRANSFER_INTEFACE((byte) 2, "接口代付");

    private byte operation;
    private String info;

    WithdrawOperationEnum(byte operation, String info) {
        this.operation = operation;
        this.info = info;
    }

    public byte getOperation() {
        return operation;
    }

    public void setOperation(byte operation) {
        this.operation = operation;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public static String getInfo(Byte operation) {

        String info = "";

        if (null != operation) {
            for (WithdrawOperationEnum p : WithdrawOperationEnum.values()) {
                if (operation.equals(p.getOperation())) {
                    info = p.getInfo();
                    break;
                }
            }
        }

        return info;
    }
}
